package com.example.hospitalmanagementapp

import adapter.PeopleInformationAdapter
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.recyclerview.widget.LinearLayoutManager
import kotlinx.android.synthetic.main.activity_people_information.*

class PeopleInformationActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_people_information)
        initView()
    }

    private fun initView() {
        // 加载适配器
        people_information.layoutManager=LinearLayoutManager(this)
        var dataList:MutableList<PeopleInformationModel> = mutableListOf(
            PeopleInformationModel("诊疗号","3600003545466")
           , PeopleInformationModel("姓名","王凡")
           ,PeopleInformationModel("类型","成人")
            ,PeopleInformationModel("性别","男")
            ,PeopleInformationModel("手机号","18629341161")
            ,PeopleInformationModel("证件类型","身份证")
            ,PeopleInformationModel("证件号","61232619970610591X")
            ,PeopleInformationModel("出生日期","1997—06—10")
            ,PeopleInformationModel("详细地址","陕西省汉中市宁强县毛坝河镇毛坝河村4组")
            ,PeopleInformationModel("默认就诊人","是"))

       var adapter=PeopleInformationAdapter(this)
        adapter.dataList=dataList
        people_information.adapter=adapter
        // 实现删除功能
        delete_information.setOnClickListener {
         finish()
        }
    }
}